package com.icangya.DAO.impl;

import com.icangya.DAO.IAliPayCashRecordDAO;
import com.icangya.Utils.SQLUtilt;
import com.icangya.domain.AliPayCashRecord;
import org.springframework.stereotype.Repository;

import java.util.List;

import static com.icangya.Value.FootBall.FOOT_PAGE_ROW;


@Repository
public class AliPayCashRecordDAOImpl  extends BaseDAO<AliPayCashRecord> implements IAliPayCashRecordDAO {

    @Override
    public List getAliPayRecord(int startPage) {

        String hql=" FROM AliPayCashRecord alc where alc.status=1";
        String count="Select COUNT(alc) "+hql;
        Long total= (Long) getHibernateTemplate().find(count).get(0);
        return SQLUtilt.getIstance().doPage(getHibernateTemplate(),hql,total,startPage,FOOT_PAGE_ROW);
    }
}
